from django.db import models

# Create your models here.


class PointsMallGoods(models.Model):
    """
    积分商城中的商品表
    """
    name = models.CharField(max_length=20, verbose_name='商品名称')
    desc = models.CharField(max_length=50, verbose_name='商品简介')
    detail = models.TextField(verbose_name='商品详情')
    image = models.URLField(verbose_name='图片地址', default='')
    price = models.IntegerField(default=0, verbose_name='商品积分价格')
    count = models.IntegerField(default=100, verbose_name='商品库存数量')
    lock_count = models.IntegerField(default=0, verbose_name='锁定数量')
    sale_count = models.IntegerField(default=0, verbose_name='出售数量')

    class Meta:
        """
        重命名
        """
        db_table = 'points_mall_goods'


class PointsMallPicture(models.Model):
    """
    图片地址
    """
    goods_id = models.IntegerField(default=0, verbose_name='关联的产品id')
    url_path = models.CharField(max_length=200, blank=True, null=True, verbose_name='图片视频地址')

    class Meta:
        """
        重命名
        """
        db_table = 'points_mall_goods_picture'
